<!--
    group: 企业管理
    name: 我的企业
    url: /enterprise/myEnterprise
-->
<template>
    <div id="components-form-demo-vuex1">

    <PageCard>

      <PageForm ref="PageForm" :formEvent="formEvent1" :itemList="itemList_" :formConfig="formConfig_">
        <template v-slot:date11 ="itemData">
           {{ itemData }}
        </template>
      </PageForm>
      <a-button @click="formEvent" type="primary">
      提交
    </a-button>

    </PageCard>
  </div>
</template>

<script>

export default {
  name: 'myEnterprise',

  data(){
    return {
      formConfig_:{columnCount:3},
      itemList_:[
        { enName:'userName',cnName:'用户名',type:'input',value:'1'},
        { enName:'password',cnName:'下拉框',type:'select',value:'key2', optionList:[{enName:'key1',cnName:'下来选项1'},{enName:'key2',cnName:'下来选项2'},]},
        { enName:'date',cnName:'日期',type:'input',value:'', isChangeEvent:true, itemAttr:{showCount:true,  maxLength:100, placeholder:' 测试', rows:4}},
        // { enName:'date1',cnName:'日期1',type:'input',value:'32', monoRow:false, formItemAttr:{ labelCol:{span: 2}, wrapperCol:{span: 22}}},
        { enName:'date1',cnName:'日期1',type:'input',value:'32', monoRow:false},
        { enName:'date11',cnName:'自定义组件',type:'custom',value:'自定义组件值', monoRow:true, formItemAttr:{ labelCol:{span: 2}, wrapperCol:{span: 22}}},
        { enName:'date2',cnName:'日期2',type:'input',value:'33', isRequire: true,},
        { enName:'date21',cnName:'日期21',type:'label',value:'用于显示文本数据', itemAttr:{ class:'ss', style:{ fontWeight: 700,fontSize: '20px'}}},
        { enName:'date3',cnName:'日期3',type:'radioGroup',value:'key22', optionList:[{enName:'key12',cnName:'按钮1'},{enName:'key22',cnName:'按钮2'},]},
        // { enName:'date4',cnName:'日期4',type:'input',value:'35', monoRow:false, formItemAttr:{ labelCol:{span: 2}, wrapperCol:{span: 22}}},
        { enName:'date4',cnName:'日期4',type:'input',value:'35', monoRow:false, formItemAttr:{ }},
        { enName:'date5',cnName:'日期5',type:'checkboxGroup',value:['Pear'], optionList:[{ label: 'Pear', value: 'Pear' },{ label: 'Apple', value: 'Apple' }]},
        { enName:'date6',cnName:'日期6',type:'input',value:'37', isRequire: [{ required: true, message: 'Username is <a>表单</a> required!' }]},
        { enName:'date61',cnName:'日期61',type:'textarea',value:'', isRequire: true, itemAttr:{ placeholder:'请填写<a>表单</a>信息', autoSize:{minRows: 3, maxRows: 5}}},
      ]
    }
  },

  created() {

  },
  mounted(){

  },
  methods: {
    formEvent1(type,data){
      console.log('formEvent==>',type,data);
    },
    formEvent(){
      // this.$refs.PageForm.setOptionListData({isCover:false, password:[{key: 'key13',enName:'key13',cnName:'下来选项13'},{key: 'key23',enName:'key23',cnName:'下来选项23'},{key: 'key33',enName:'key33',cnName:'下来选项33'}]})
      // this.$refs.PageForm.setFieldValue({password:'key23'})

      this.$refs.PageForm.handleSubmit()

      // console.log(this.$refs.PageForm.formObjData);
    }
  },
}
</script>

<style >
#components-form-demo-vuex .language-bash {
  max-width: 400px;
  border-radius: 6px;
  margin-top: 24px;
}
</style>
